﻿@model Ch06.Models.Product

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        <h4>Product</h4>
        <hr />
        @Html.ValidationSummary(true)

        <div class="form-group">
            @Html.LabelFor(model => model.ProductName, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.ProductName)
                @Html.ValidationMessageFor(model => model.ProductName)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.SupplierID, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.SupplierID)
                @Html.ValidationMessageFor(model => model.SupplierID)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.CategoryID, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.CategoryID)
                @Html.ValidationMessageFor(model => model.CategoryID)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.QuantityPerUnit, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.QuantityPerUnit)
                @Html.ValidationMessageFor(model => model.QuantityPerUnit)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.UnitPrice, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.UnitPrice)
                @Html.ValidationMessageFor(model => model.UnitPrice)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.UnitsInStock, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.UnitsInStock)
                @Html.ValidationMessageFor(model => model.UnitsInStock)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.UnitsOnOrder, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.UnitsOnOrder)
                @Html.ValidationMessageFor(model => model.UnitsOnOrder)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.ReorderLevel, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.ReorderLevel)
                @Html.ValidationMessageFor(model => model.ReorderLevel)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Discontinued, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Discontinued)
                @Html.ValidationMessageFor(model => model.Discontinued)
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Create" class="btn btn-default" />
            </div>
        </div>
    </div>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
